package com.gzhryc.shared_device.cdb.code.dao.db;

import com.gzhryc.jdbc.annotaion.*;
import com.gzhryc.shared_device.cdb.code.dao.enums.BatteryCabinetEnum;
import com.gzhryc.shared_device.common.device.dao.db.Device;

import java.io.Serializable;
import java.util.Date;

/**
 * 共享充电宝机柜
 * 
 * @author zhanghao
 * @version 2022-09-04
 */
@Table(name = "dev_battery_cabinet")
public class BatteryCabinet implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id(auto = false)
	@Column(name = "device_sn")
	protected String deviceSn;

	@Column(name = "device_type_id")
	protected String deviceTypeId;

	@Column(name="device_type_name",note = "设备类型名称")
	protected String deviceTypeName;

	@Column(name = "slot_total", notNull = true, defVal = "1", note = "卡槽数")
	protected Integer slotTotal;

	@Column(name = "version_number", length = 64, note = "版本号")
	protected String versionNumber;

	@Column(name = "iot_type", length = 4, note = "设备IOT类型")
	protected Integer iotType;

	@Column(name = "iot_node_id", note = "连接的IOT节点ID")
	protected Long iotNodeId;

	@Column(name = "protocol_type", length = 16, notNull = true, defVal = "CDB_V1", note = "协议类型")
	protected String protocolType;

	@Column(name = "card_num", length = 64, note = "物联网卡号")
	protected String cardNum;

	@Column(note = "国际移动用户识别码")
	protected String imsi;

	@Column(note = "SIM卡号")
	protected String iccid;

	@Column(note = "信号强度")
	protected Integer rssi;

	@Column(notNull = true, defVal = "1", note = "设备状态")
	protected Integer state;

	@Column(name = "last_offline_date", note = "上次离线时间")
	protected Date lastOfflineDate;

	@Column(length = 128,note = "备注")
	protected String note;

	@Column(name = "update_date", autoUpdateTime = true, note = "最后修改时间")
	protected Date updateDate;

	@Column(name = "create_date")
	protected Date createDate;

	@Join(fromField = "device_sn",toField = "device_sn")
	protected Device device;

	protected Date heartbeatData;       //心跳时间

	public String getDeviceSn() {
		return deviceSn;
	}

	public void setDeviceSn(String deviceSn) {
		this.deviceSn = deviceSn;
	}

	public String getDeviceTypeId() {
		return deviceTypeId;
	}

	public void setDeviceTypeId(String deviceTypeId) {
		this.deviceTypeId = deviceTypeId;
	}

	public String getDeviceTypeName() {
		return deviceTypeName;
	}

	public void setDeviceTypeName(String deviceTypeName) {
		this.deviceTypeName = deviceTypeName;
	}

	public String getVersionNumber() {
		return versionNumber;
	}

	public void setVersionNumber(String versionNumber) {
		this.versionNumber = versionNumber;
	}

	public String getCardNum() {
		return cardNum;
	}

	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}

	public String getImsi() {
		return imsi;
	}

	public void setImsi(String imsi) {
		this.imsi = imsi;
	}

	public String getIccid() {
		return iccid;
	}

	public void setIccid(String iccid) {
		this.iccid = iccid;
	}

	public Integer getRssi() {
		return rssi;
	}

	public void setRssi(Integer rssi) {
		this.rssi = rssi;
	}

	public Integer getSlotTotal() {
		return slotTotal;
	}

	public void setSlotTotal(Integer slotTotal) {
		this.slotTotal = slotTotal;
	}

	public Integer getIotType() {
		return iotType;
	}

	public void setIotType(Integer iotType) {
		this.iotType = iotType;
	}

	public Long getIotNodeId() {
		return iotNodeId;
	}

	public void setIotNodeId(Long iotNodeId) {
		this.iotNodeId = iotNodeId;
	}

	public String getProtocolType() {
		return protocolType;
	}

	public void setProtocolType(String protocolType) {
		this.protocolType = protocolType;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getLastOfflineDate() {
		return lastOfflineDate;
	}

	public void setLastOfflineDate(Date lastOfflineDate) {
		this.lastOfflineDate = lastOfflineDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Device getDevice() {
		return device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}

	public String getStateName() {
		return BatteryCabinetEnum.State.note(this.state);
	}

	public Date getHeartbeatData() {
		return heartbeatData;
	}

	public void setHeartbeatData(Date heartbeatData) {
		this.heartbeatData = heartbeatData;
	}
}
